/*
 * Element.hpp
 *
 *  Created on: 27-12-2010
 *      Author: Przemek
 */

#pragma once

#include "geometry/Rectangle.hpp"

class SingleElementInfoPanel;
class ElementsVisitor;

/*
 * Base class for every element which can be in world. It includes selection, drawing, adding and deleting.
 */
class Element
{
	protected:
		geometry::Rectangle bounds;
		bool toDelete;

	public:
		Element();
		virtual ~Element();
		// don't add directly any elements to world while updating (use World::scheduleToAdd)
		virtual void updateWithDeltaTime(float deltaTimeInSeconds) = 0;
		virtual void accept(ElementsVisitor& visitor) = 0;

		void setPosition(const Vector& position);
		const Vector& getPosition() const;
		void setBounds(const geometry::Rectangle& bounds);
		const geometry::Rectangle getBounds() const;
		const Dimension& getSize() const;
		void setToDelete(bool toDelete);
		bool isToDelete() const;
};

